package org.geekbang.projects.cs.im.util;

import io.netty.channel.Channel;
import io.netty.util.Attribute;

/**
 * @description:
 * @author: Kaijun Chen
 * @date: 2023/3/6
 **/
public class LoginUtil {

    public static void markAsLogin(Channel channel) {
        channel.attr(Attributes.LOGIN);
    }

    public static boolean hasLogin(Channel channel) {
        Attribute<Boolean> login = channel.attr(Attributes.LOGIN);
        return login.get() != null;
    }

}
